//
//  NewsHeaderView.m
//  Mtime2.0
//
//  Created by 凉气的Mac on 16/9/21.
//  Copyright © 2016年 凉气的Mac. All rights reserved.
//

#import "NewsHeaderView.h"

@interface NewsHeaderView ()

@property(nonatomic,weak) UIImageView *picture;

@property(nonatomic,weak) UILabel *titleLabel;

@end

@implementation NewsHeaderView


-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
        //设置界面
        [self setupUI];
        
    }
    return self;
}

#pragma mark --
#pragma mark --设置界面
-(void)setupUI{
    
    UIImageView *picture = [[UIImageView alloc]init];
    
    picture.image = [UIImage imageNamed:@"1"];
    
    self.picture = picture;
    
    [self addSubview:picture];
    
    [picture mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.right.equalTo(self);
        
        make.bottom.equalTo(self);
        
    }];
    
    UILabel *titleLbel = [[UILabel alloc]init];
    
    titleLbel.textColor = [UIColor whiteColor];
    
    titleLbel.backgroundColor = [UIColor blackColor];
    
    titleLbel.alpha = 0.5;
    
    titleLbel.textAlignment = NSTextAlignmentCenter;
    
    titleLbel.text = @"水电费很纠结的交换机";
    
    self.titleLabel = titleLbel;
    
    [self addSubview:titleLbel];
    
    [titleLbel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.width.bottom.equalTo(picture);
        
        make.height.equalTo(@30);
        
    }];
    
    
}






@end

















